﻿@model Model.Sys.RoleInfo
@using WebPortal.MvcExtension
@{
    ViewBag.Title = "配置角色权限";
    Layout = "~/Views/Shared/_Main.cshtml";
}
@section Head{
    <script type="text/javascript">
        $(function () {
            page_Init();
        });
        function page_Init() {
            $("body").css("overflow", "hidden");
        }
        function btnSave_Click() {
            submitForm();
            //$("#ff").submit();
        }

        function btnClose_Click() {
            returnParent(null);
        }
        //----------提交数据 ----------------
        function submitForm() {

            if ($('#ff').form("validate")) {
                var postUrl = "/Role/UpDate";
                var postData = $(":input").serialize();
                //postData = $(":hidden,:text,:checkbox").serialize();
                $.ajax({
                    type: "POST",
                    async: true,
                    url: postUrl,
                    data: postData,
                    success: function (result) {
                        if (result.Success == true) {
                            alert(result.Message);
                            returnParent(null);
                        }
                        else {
                            alert(result.Message);
                        }
                    }
                });
            }
        }
        //----------提交数据 END----------------
    </script>
}
<div style="height: 480px; overflow-y: scroll;">
    <div style="margin: 5px;">
        @using (Html.BeginForm("UpDate", "Role", FormMethod.Post, new { id = "ff" }))
        {
            @Html.HiddenFor(model => model.Id)
            <input type="hidden" name="includeRole@(Model.Id)" value="false" />
            var dataConfigToolbar = new ViewDataDictionary();
            dataConfigToolbar.Add("PanelTitle", "配置访问权限");
            dataConfigToolbar.Add("ShowSaveButton", true);
            @Html.Partial("_ToolBarPanel", dataConfigToolbar);
            <div style="width: 100%; height: 400px; overflow: hidden; overflow-y: auto; margin-right: 4px">
                @Html.Partial("_RoleDBConfig", Model.RoleDBItems)
            </div>
        }
    </div>
</div>
